<%= render :partial => "profile/submenu" %>
<% user = User.find(session[:user_id]) %>
<% friend_request_count = user.friend_request_count.to_i %>

<div id="column-1" class="column" style="width: 76%">
	
	<% if friend_request_count != 0 %>

		<ul class="portrait-list">
	
			<% for friend in @friends do %>
				<% if friend.user_id != session[:user_id] && friend.status == "0" %>
				<li class="item" 
					style="width:100px; height:165px;">
					<% if friend.user_id == session[:user_id]
						 user = User.find(friend.friend_user_id)
					   else
						 user = User.find(friend.user_id)
					   end
					%>
					<%= link_to_profile user.id, 'medium' %>
					
					<p>
						<%= link_to user.name, {:controller => :profile,
									:action => :show,
									:id => user} %>
						<br />
						
						<%= link_to "Best&auml;tigen", {:controller => :friend,
														:action => :confirm,
														:id => friend.id },
													   {:method => :post,
														:confirm => "Bist du dir sicher?"} %>
					</p>
				</li>
				<% end %>
			<% end %>
			
		</ul>
		
		<div class="red-line">&nbsp;</div>
	
	<% end %>
	
	<ul class="portrait-list">
		
		<% for friend in @friends do %>
			<% if friend.status == "1" %>
			<li class="item" 
				style="width:100px; height:145px;">
				<% if friend.user_id == session[:user_id]
					 user = User.find(friend.friend_user_id)
				   else
					 user = User.find(friend.user_id)
				   end
				%>
				<%= link_to_profile user.id, 'medium' %>
				
				<p>
					<%= link_to user.name, {:controller => :profile,
								:action => :show,
								:id => user} %>
				</p>
			</li>
			<% end %>
		<% end %>
		
	</ul>
</div>
